<div class="layui-fluid">
    <div class="layui-card">
        <div class="layui-form layui-card-header layuiadmin-card-header-auto" lay-filter="LAY-list-form">
            <div class="layui-form-item">
                <div class="layui-inline">
                    <label class="layui-form-label">店铺</label>
                    <div class="layui-input-block">
                        <select name="shop" lay-search>
                            <option value="">请选择店铺</option>
                        </select>
                    </div>
                </div>
                <div class="layui-inline">
                    <label class="layui-form-label">SKU</label>
                    <div class="layui-input-block">
                        <input type="text" name="sku" placeholder="" autocomplete="off" class="layui-input">
                    </div>
                </div>
                <div class="layui-inline">
                    <button style="display:none" class="down" lay-submit="" lay-filter="LAY-list-down">下载</button>
                    <button class="layui-btn layuiadmin-btn-useradmin search" lay-submit lay-filter="LAY-list-search">搜索</button>
                </div>
            </div>
        </div>

        <div class="layui-card-body">
            <table id="LAY-list"  lay-filter="LAY-list"></table>
                <!-- 头部工具栏 -->
                <script type="text/html" id="toolbar">
                    <div class="layui-btn-group fl layui-btn-group-jy">
                        <a lay-event="export" href="javascript:;" class="layui-btn layui-btn-primary layui-btn-sm layui-icon layui-icon-download-circle">&nbsp;导出</a>
                    </div>
                    </script>


                </div>
            </div>
        </div>
        <script>
            layui.use(['admin', 'table', 'form', 'toolJ', 'upload'], function () {
                var $ = layui.$
                        , admin = layui.admin
                        , view = layui.view
                        , table = layui.table
                        , toolJ = layui.toolJ
                        , form = layui.form
                        , upload = layui.upload;
                //国家sku管理
                var shop = layui.data('yujiso').shop;
                var selectHtml = '';
                for (var i in shop) {
                    selectHtml += '<option value="' + i + '">' + shop[i] + '</option>';
                }
                $("select[name='shop']").append(selectHtml);

                form.render(null, 'LAY-list-form');
                table.render({
                    elem: '#LAY-list'
                    , url: '/index/Saleoreport/getStoreSkuList'
                    , toolbar: '#toolbar'
                    , defaultToolbar: ['filter']
                    ,cellMinWidth:80
                    , cols: [[
                             {field: 'shop_name', title: '店铺'}
                            , {field: 'sku', title: 'SKU'}
                            , {field: 'cname', title: '中文名称'}
                            , {field: 'sku_state', title: 'SKU状态'}
                            , {field: 'cycle_stage', title: '备货状态'}
                            , {field: 'daily_average', title: '日均销量'}
                            , {field: '7day_average', title: '7日销量'}
                            , {field: '14day_average', title: '14日销量'}
                            , {field: '21day_average', title: '21日销量'}
                            , {field: '28day_average', title: '28日销量'}
                            , {field: 'year_saleamount', title: '年总销量'}
                            , {field: 'saleamount', title: '累计销量'}
                            , {field: 'total_money', title: '年总销额'}
                            , {field: 'total_cost_money', title: '总成本金额（¥）'}
                        ]]
                    , page: true
                    , limit: 10
                    ,text:{none: '暂无相关数据!' }
 });
        //监听头部工具栏 操作
        table.on('toolbar(LAY-list)', function (obj) {
		
            //选中的数据
            var checkStatus = table.checkStatus('LAY-list')
                , data = checkStatus.data;
            //event对应模板的
            switch (obj.event) {
                case 'export':
                    $('.down').click();
                    break;

            }
        });  
});
        </script>
